import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        selectedFlowerId: null // 示例状态
    },
    mutations: {
        setSelectedFlowerId(state, payload) {
            state.selectedFlowerId = payload;
        }
    },
    actions: {
        updateSelectedFlowerId({ commit }, flowerId) {
            commit('setSelectedFlowerId', flowerId);
        }
    },
    getters: {
        getSelectedFlowerId: state => state.selectedFlowerId
    }
});